<template>
  <div>
    <h1>{{ msg }}</h1>
    <button @click="reversebtn">点击翻转大写</button>
    <button @click="reversebtn1">点击翻转小写</button>
  </div>
</template>

<script>
function rev(str) {
  return str.split('').reverse().jion('')
}
export default {
  data() {
    return {
      msg: 'hello world',
    }
  },
  methods: {
    reversebtn() {
      this.msg = rev(this.msg).toUpperCase()
      // console.log(this.msg)
    },
    reversebtn1() {
      this.msg = rev(this.msg).toLowerCase()
      // console.log(this.msg)
    },
  },
}
</script>

<style></style>
